package com.bw.controller;

import com.bw.bean.Vo;
import com.bw.dao.DayDao;
import com.bw.service.DayService;
import com.sugar.SugarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class Daycontroller {
    @Autowired
    DayService dayService;

    @RequestMapping("/finddaylist")
    public List<Map<String,Object>> finddaylist(){
        return dayService.finddaylist();
    }

    @RequestMapping("/find18")
    public Map find18(){
        DayDao dayService18 = dayService.find18();
        return SugarUtil.getFlipNumberData(dayService18);
    }

    @RequestMapping("/find19")
    public Map find19(){
        List<Vo> dayService19 = dayService.find19();
        return SugarUtil.getMapData(dayService19);
    }

    @RequestMapping("/find20")
    public Map find20(){
        List<Vo> dayService20 = dayService.find20();
        return SugarUtil.getBarData(dayService20);
    }
}
